<?php
$catesoption_data = array();
foreach ($categories as $cat) {
    $catesoption_data[$cat['id']] = $cat['name'];    
}
foreach($catesoption_data as $key=>$cat){
    echo '<li><a href="'.site_url('ticket/list-ticket/'.$key).'">' . $cat . '</a></li>';
}

//print_r($categories);